﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	xmlns:myBoard_Framework_Effects="clr-namespace:myBoard.Framework.Effects"
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
	x:Class="myBoard.Framework.Controls.Navigation.BreadcrumbExplorer"
	x:Name="UserControl"
	d:DesignWidth="640" d:DesignHeight="480">
	<UserControl.Resources>
		<SolidColorBrush x:Key="ListBorder" Color="#828790"/>
		<Style x:Key="BreadcrumbListBoxStyle" TargetType="{x:Type ListBox}">
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBox}">
						<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1" CornerRadius="5">
							<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" d:LayoutOverrides="Width"/>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							</Trigger>
							<Trigger Property="IsGrouping" Value="true">
								<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="BreadcrumbListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="Padding" Value="2,0,0,0"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBoxItem}">
						<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<ItemsPanelTemplate x:Key="BreadcrumbItemsPanelTemplate">
			<VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal"/>
		</ItemsPanelTemplate>
		<DataTemplate x:Key="BreadcrumbEntityDataTemplate">
			<Grid>
				<Button x:Name="_breadcrumbEntityBt" HorizontalAlignment="Left" Width="Auto" Content="{Binding}" d:LayoutOverrides="Height" FontSize="10.667" MouseEnter="BreadcrumbEntityBt_MouseEnter" MouseLeave="_breadcrumbEntityBt_MouseLeave" Click="_breadcrumbEntityBt_Click" Style="{DynamicResource BredcrumbEntityButonStyle}" Foreground="White" Cursor="Hand" BorderBrush="White"/>
			</Grid>
		</DataTemplate>
    <Storyboard x:Key="Scroll">
      <ThicknessAnimationUsingKeyFrames x:Name="MarginTimeline" BeginTime="00:00:00" Storyboard.TargetName="_entitiesControlsContainer" Storyboard.TargetProperty="(FrameworkElement.Margin)">
        <SplineThicknessKeyFrame KeySpline="0.45,0,0,1" KeyTime="00:00:00.4000000" Value="565,0,0,0"/>
      </ThicknessAnimationUsingKeyFrames>
      <DoubleAnimationUsingKeyFrames x:Name="MotionblurAmountTimeline" BeginTime="00:00:00" Storyboard.TargetName="_entitiesControlsContainer" Storyboard.TargetProperty="(UIElement.Effect).(myBoard_Framework_Effects:DirectionalBlur.BlurAmount)">
      	<SplineDoubleKeyFrame KeyTime="00:00:00.200000" Value="0.001"/>
      	<SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0"/>
      </DoubleAnimationUsingKeyFrames>
      <DoubleAnimationUsingKeyFrames x:Name="MotionblurAngleTimeline" BeginTime="00:00:00" Storyboard.TargetName="_entitiesControlsContainer" Storyboard.TargetProperty="(UIElement.Effect).(myBoard_Framework_Effects:DirectionalBlur.Angle)" Duration="00:00:00.0010000">
      	<SplineDoubleKeyFrame KeyTime="00:00:00" Value="3.14"/>
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
		<Style x:Key="ButtonFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#F3F3F3" Offset="0"/>
			<GradientStop Color="#EBEBEB" Offset="0.5"/>
			<GradientStop Color="#DDDDDD" Offset="0.5"/>
			<GradientStop Color="#CDCDCD" Offset="1"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
		<Style x:Key="BredcrumbEntityButonStyle" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<StackPanel Width="Auto" Orientation="Horizontal" Margin="0">
							<StackPanel Height="Auto" Panel.ZIndex="2" d:LayoutOverrides="Width" Orientation="Horizontal">
								<Image Source="{Binding Icon}" Width="Auto" Height="Auto" Margin="2,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
								<TextBlock Margin="0" Text="{Binding Name}" TextWrapping="Wrap" Padding="5,0" VerticalAlignment="Center"/>
							</StackPanel>
							<Path Fill="{TemplateBinding BorderBrush}" Stretch="Fill" Stroke="#FFD0D0D0" StrokeThickness="0" Width="7" Height="7" RenderTransformOrigin="0.5,0.5" Data="M0,0 L7,0 7,7 5.6307484,1.3692516 z">
								<Path.RenderTransform>
									<TransformGroup>
										<ScaleTransform/>
										<SkewTransform/>
										<RotateTransform Angle="45"/>
										<TranslateTransform X="8.8817841970012523E-16"/>
									</TransformGroup>
								</Path.RenderTransform>
							</Path>
						</StackPanel>
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true"/>
							<Trigger Property="ToggleButton.IsChecked" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="#ADADAD"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot" ClipToBounds="True">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="0.9*"/>
		</Grid.RowDefinitions>
		<ScrollViewer x:Name="_scrollViewer" Margin="0" VerticalAlignment="Center" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
			<ListBox x:Name="_breadCrumb" Style="{DynamicResource BreadcrumbListBoxStyle}" ItemContainerStyle="{DynamicResource BreadcrumbListBoxItemStyle}" ItemsPanel="{DynamicResource BreadcrumbItemsPanelTemplate}" ItemTemplate="{DynamicResource BreadcrumbEntityDataTemplate}" Height="22.413" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
				<ListBox.Background>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="#FF404040" Offset="0"/>
						<GradientStop Color="#FF323232" Offset="1"/>
						<GradientStop Color="#FF404040" Offset="0.5"/>
						<GradientStop Color="#FF323232" Offset="0.501"/>
					</LinearGradientBrush>
				</ListBox.Background>
			</ListBox>
		</ScrollViewer>
		<StackPanel HorizontalAlignment="Left" x:Name="_entitiesControlsContainer" Margin="0" Grid.Row="1" Orientation="Horizontal">
			<!--<StackPanel.Effect>
				<myBoard_Framework_Effects:DirectionalBlur/>
			</StackPanel.Effect>-->
		</StackPanel>
	</Grid>
</UserControl>